//=============================================================
// 创建人:            ssd
// 创建时间:          11/20/2024 10:31:03 AM
// 邮箱：             1292934053@qq.com
//==============================================================
using LF.Common;
using LF.Domain.Entities;
using LF.Domain.Helper;

namespace LF.Domain.Services.Iml
{
    public class UserDeptManagerService : IUserDeptManagerService
    {
        public List<UserDept> All(int index, int pageSize,string? key)
        {
            var query = FreeSqlHelper.DbContext.Queryable<UserDept>
    ();
    if (!key.IsNullOrWhiteSpace())
    {
    //query = query.Where(p => p.XX.Contains(key) || p.XX.Contains(key));
    }
    var list = query.Where(p=>!p.IsDelete)
    .OrderByDescending(p => p.UpdateTime)
    .Page(index, pageSize)
    .ToList();
    return list;
    }

    public long Count(string? key)
    {
    var query = FreeSqlHelper.DbContext.Queryable<UserDept>
        ();
        if (!key.IsNullOrWhiteSpace())
        {
        //query = query.Where(p => p.XX.Contains(key) || p.XX.Contains(key));
        }
        var count = query.Count();
        return count;
        }
        }
        }

